package com.ruoyi.veterinary.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.veterinary.mapper.VetBillDetailMapper;
import com.ruoyi.veterinary.domain.VetBillDetail;
import com.ruoyi.veterinary.service.IVetBillDetailService;

/**
 * 账单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-19
 */
@Service
public class VetBillDetailServiceImpl implements IVetBillDetailService 
{
    @Autowired
    private VetBillDetailMapper vetBillDetailMapper;

    /**
     * 查询账单明细
     * 
     * @param detailId 账单明细主键
     * @return 账单明细
     */
    @Override
    public VetBillDetail selectVetBillDetailByDetailId(Long detailId)
    {
        return vetBillDetailMapper.selectVetBillDetailByDetailId(detailId);
    }

    /**
     * 查询账单明细列表
     * 
     * @param vetBillDetail 账单明细
     * @return 账单明细
     */
    @Override
    public List<VetBillDetail> selectVetBillDetailList(VetBillDetail vetBillDetail)
    {
        return vetBillDetailMapper.selectVetBillDetailList(vetBillDetail);
    }

    /**
     * 根据账单ID查询明细列表
     * 
     * @param billId 账单ID
     * @return 账单明细集合
     */
    @Override
    public List<VetBillDetail> selectVetBillDetailByBillId(Long billId)
    {
        return vetBillDetailMapper.selectVetBillDetailByBillId(billId);
    }

    /**
     * 新增账单明细
     * 
     * @param vetBillDetail 账单明细
     * @return 结果
     */
    @Override
    public int insertVetBillDetail(VetBillDetail vetBillDetail)
    {
        vetBillDetail.setCreateTime(DateUtils.getNowDate());
        return vetBillDetailMapper.insertVetBillDetail(vetBillDetail);
    }

    /**
     * 修改账单明细
     * 
     * @param vetBillDetail 账单明细
     * @return 结果
     */
    @Override
    public int updateVetBillDetail(VetBillDetail vetBillDetail)
    {
        return vetBillDetailMapper.updateVetBillDetail(vetBillDetail);
    }

    /**
     * 批量删除账单明细
     * 
     * @param detailIds 需要删除的账单明细主键
     * @return 结果
     */
    @Override
    public int deleteVetBillDetailByDetailIds(Long[] detailIds)
    {
        return vetBillDetailMapper.deleteVetBillDetailByDetailIds(detailIds);
    }

    /**
     * 删除账单明细信息
     * 
     * @param detailId 账单明细主键
     * @return 结果
     */
    @Override
    public int deleteVetBillDetailByDetailId(Long detailId)
    {
        return vetBillDetailMapper.deleteVetBillDetailByDetailId(detailId);
    }
}